#include <stdio.h>
#include <asm/ioctls.h>
#include <asm/termbits.h>
#include <asm/termios.h>
#include "Private.h"
#include "System.h"

/// <summary>
/// The TerminalOpen function
/// returns the process ID of
/// the current process.
/// </summary>
int TerminalOpen(void)
{
	int handle = -1;
	if ((handle = Open(L"", 0, 0)) < 0)
		return -1;
	return handle;
}

/// <summary>
/// The TerminalGetRows function
/// returns the process ID of
/// the current process.
/// </summary>
int TerminalGetRows(void)
{
	struct winsize ws;
	if (IoControl(0, TIOCGWINSZ, &ws) < 0)
        return -1;
	printf("Rows: %d\n", ws.ws_row);
	return 0;
}
